import Vue from 'vue'
import VueRouter from 'vue-router'
import temp from '../views/temp.vue'
import index from '@/views/backEnd/index.vue' //首页，用于发布公告 以及活动啥的
import cart from '@/views/backEnd/cart.vue'  //菜单，用户用于点餐
import shop from '@/views/backEnd/shop.vue'  //购物车
import set from '@/views/backEnd/set.vue'  //用户个人设置


Vue.use(VueRouter)

const routes = [ //注册路由
  {
    path: '',
    redirect: '/index'
  },
  {
    path: '/temp',
    name: 'temp',
    component: temp
  },
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/cart',
    name: 'cart',
    component: cart
  },
  {
    path: '/shop',
    name: 'shop',
    component: shop
  },
  {
    path: '/set',
    name: 'set',
    component: set
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
